﻿namespace MultipleMonitorVideo.Utilities
{
    using System.Windows;
    using System.Windows.Forms;

    public static class WindowFactory
    {
        public static TWindow BuildWindow<TWindow>(Screen screen)
            where TWindow : Window, new()
        {
            TWindow window = new TWindow();
            WindowFactory.ModifyWindow<TWindow>(window, screen);

            return window;
        }

        private static void ModifyWindow<TWindow>(TWindow window, Screen screen)
            where TWindow : Window
        {
            window.WindowStartupLocation = WindowStartupLocation.Manual;
            window.Top = screen.Bounds.Top;
            window.Left = screen.Bounds.Left;
        }
    }
}
